import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/Login'
import Register from '@/views/Register'
import MyFollow from '@/views/personal/MyFollow'
import PersonalCenter from '@/views/personal/PersonalCenter'
import EditInfo from '@/views/personal/EditInfo'
import Channel from '@/views/newsinfo/Channel'
import Search from '@/views/newsinfo/Search'
import index from '@/views/index'
import myCollection from '@/views/personal/MyCollection'
import NewsDetail from '@/views/newsinfo/NewsDetail'
import MyPost from '@/views/personal/MyPost'
import FunnyComment from '@/views/newsinfo/FunnyComment'

Vue.use(VueRouter)

  const routes = [
    {path:'/login',component:Login},
    {path:'/register',component:Register},
    {path:'/',component:index},
    {name:'myFollow',path:'/myFollow',component:MyFollow,meta:{auth:true}},
    {name:'personalCenter',path:'/personalCenter',component:PersonalCenter,meta:{auth:true}},
    {name:'editInfo',path:'/editInfo',component:EditInfo,meta:{auth:true}},
    {name:'channel',path:'/channel',component:Channel},
    {name:'search',path:'/search',component:Search},
    {name:'myCollection',path:'/myCollection',component:myCollection},
    {name:'newsDetail',path:'/newsDetail/:id',component:NewsDetail},
    {name:'myPost',path:'/myPost',component:MyPost},
    {name:'funnyComment',path:'/funnyComment/:id',component:FunnyComment}
  ]

const router = new VueRouter({routes})

export default router
